﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<%--
<div id="unreadmsg">
    <div>--%>
<ul>
    <!--task-->
    <%using (var dtur_wftask = ViewData["dtur_wftask"] as System.Data.DataTable)
      {

          int num = 0;
          if (dtur_wftask.Rows.Count > 0)
          { 
    %>
    <li class="titleli" style="cursor:pointer;">
        <p style="color: #005590; font-weight: normal; font-size: 12px;">
            待办审批:</p>
    </li>
    <%
        }
                  for (int i = 0; i < dtur_wftask.Rows.Count; i++)
                  {
                      num++;
    %>
    <li class="unreadmsg" onclick="autodel(this)">
        <%=Ajax.ActionLink("待办" + num.ToString() + ": " + dtur_wftask.Rows[i]["流程名称"].ToString() + "(" + dtur_wftask.Rows[i]["发起人"].ToString() + " " +DateTime.Parse( dtur_wftask.Rows[i]["开始时间"].ToString()).ToString("yyyy-MM-dd")+")", "WFProcess", "WorkFlow", new
                {
                        uniqueid= dtur_wftask.Rows[i]["实例标识"], task_id = dtur_wftask.Rows[i]["任务编码"], 
                        ptask_id= dtur_wftask.Rows[i]["父级编码"] }, new AjaxOptions { UpdateTargetId = "workarea-2-2-examine",
                                    OnSuccess = "addtab('2-2-examine','审批')" })%></li>
    <%}
              }%>
    <!--note-->
    <%using (var dtur_note = ViewData["dtur_note"] as System.Data.DataTable)
      {
          int num = 0;
          if (dtur_note.Rows.Count > 0)
          { 
    %>
    <li class="titleli" style="cursor:pointer;">
        <p style="color: #005590; font-weight: normal; font-size: 12px;">
            定时提醒:</p>
    </li>
    <%
        }
                  for (int i = 0; i < dtur_note.Rows.Count; i++)
                  {
                      num++;
                      var text = dtur_note.Rows[i]["note_text"].ToString();
                      var fqrname = dtur_note.Rows[i]["user_name"].ToString();
                      var notetime = DateTime.Parse(dtur_note.Rows[i]["note_time"].ToString()).ToString("yyyy-MM-dd");
                      if (!String.IsNullOrEmpty(text) & text.Length > 5)
                          text = text.Substring(0, 5) + "...";
    %>
    <li class="unreadmsg" onclick="autodel(this)"><a onclick="confirmMsg(<%=dtur_note.Rows[i][0] %>)">
        <%=num.ToString() %>:<%=text+"("+fqrname+" "+notetime+")"%></a></li>
    <%}
              }%>
    <!--msg-->
    <%using (var dtur_msg = ViewData["dtur_msg"] as System.Data.DataTable)
      {
          int num = 0;
          if (dtur_msg.Rows.Count > 0)
          { 
    %>
    <li class="titleli" style="cursor:pointer;">
        <p style="color: #005590; font-weight: normal; font-size: 12px;">
            站内信:</p>
    </li>
    <%
        }
                  for (int i = 0; i < dtur_msg.Rows.Count; i++)
                  {
                      num++;
    %>
    <li class="unreadmsg" onclick="autodel(this)">
        <%=Ajax.ActionLink(num.ToString() + ": " + dtur_msg.Rows[i]["标题"].ToString() + "(" + dtur_msg.Rows[i]["发起人"].ToString() + " " +DateTime.Parse( dtur_msg.Rows[i]["发送时间"].ToString()).ToString("yyyy-MM-dd")+")", "MsgShow", "Message",
                                new
                                {
                                    msg_id = dtur_msg.Rows[i]["编码"]
                                }, new AjaxOptions { UpdateTargetId = "workarea-msg-4-1", OnSuccess = "addtab('msg-4-1','查看消息')" })%></li>
    <%}
              }%>
</ul>
</div>
<%--</div>
--%>